<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
</head>
<body>
	<script>
		/*// 声明
		function add(num1, num2) {
			return num1 + num2;
		}*/

		/*// 表达式
		var add = function(num1, num2) {
			return num1 + num2;
		}*/

		// new Function()
		var add = new Function("num1", "num2", "return num1 + num2;");

		/*function it(count) {
			for (var i = 0; i < count; i++) {
				console.log(i);
			}
		}

		

		var it = new Function("count", "for (var i = 0; i < count; i++) {console.log(i);}");*/

		var a = 5, b = 7;
		var r = add(a, b)
		console.log(r);
	</script>
</body>
</html>